package cn.edu.nju.software.zp13.core.test;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.junit.Test;
import org.w3c.dom.Document;

import cn.edu.nju.software.zp13.core.xmlNodeEntity.DomPrinter;

public class Main {
	private Document dom;

	public Main() {
		try {
			dom = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
		} catch (ParserConfigurationException e) {
			e.printStackTrace();
		}
	}

	@Test
	public void test() {
		Student s=new Student();
		s.setProfile(new Profile("ivan",12));
		s.setCourses(new Course[]{new Course("course1","course1"),new Course("course2","course2")});
		DomPrinter p=new DomPrinter();
		p.print(s.toXmlNode(dom));
	}
}
